package com.xh.bussiness.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xh.bussiness.system.dao.ParentStudentMapper;
import com.xh.bussiness.system.model.ParentStudent;
import com.xh.bussiness.system.service.IParentStudentService;
import com.xh.core.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ParentStudentServiceImpl extends BaseServiceImpl<ParentStudentMapper,ParentStudent> implements IParentStudentService {
    @Override
    public List<String> getStudentByParentId(String parentId) {
        QueryWrapper qw=new QueryWrapper<ParentStudent>();
        qw.in("parent_id",parentId);
        return this.dao.selectList(qw);
    }

    @Override
    public ParentStudent queryByParentIdAndStuId(String parentId, String studentId) {
        QueryWrapper qw=new QueryWrapper<ParentStudent>();
        qw.eq("parent_id",parentId);
        qw.eq("student_id", studentId);
        return this.dao.selectOne(qw);
    }
}
